package com.example.myapplicationktkt2.ui

import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import androidx.appcompat.app.AppCompatActivity
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.example.myapplicationktkt2.MainActivity
import com.example.myapplicationktkt2.R

class SplashActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        // 安装SplashScreen
        installSplashScreen()
        super.onCreate(savedInstanceState)
        
        setContentView(R.layout.activity_splash)
        
        // 延迟2秒后跳转到主页面
        Handler(Looper.getMainLooper()).postDelayed({
            startActivity(Intent(this, MainActivity::class.java))
            finish()
        }, 2000)
    }
}
